import axios from "axios";
const service = axios.create({
  // baseURL会自动添加在请求地址上
  baseURL: "http://localhost:3000",
  timeout: 3000,
});
// 添加请求拦截器
service.interceptors.request.use(
  (config) => {
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);
// 添加响应拦截器
service.interceptors.response.use(
  (response) => {
    return response;
  },
  (error) => {
    return Promise.reject(error);
  }
);
export default service;
